#include <iostream>
#include <string>
#include "process.cpp"

using namespace std;

int main() {
  char trace[256] =  "main.trace";

  cout << "Starting..." << endl;

  MM* mm = new MM();
  PageTable* pt = new PageTable();
  TLB* tlb = new TLB();

  MMU* mmu = new MMU(pt, tlb, mm);

  Process* p = new Process(trace);
  p->addMMU(mmu);

  int run_output = PRET_SUCCESS;
  int tick = 0;

  cout << "Running..." << endl;

  while (run_output == PRET_SUCCESS) {
    run_output = p->run(tick);
    tick++;
  }

  cout << "Closing..." << endl;

  p->close();
}
